const express = require('express');
const router = express.Router()
const pool = require('../utils/pool.js')

router.post('/order-form',(req,res,next)=>{
  let {sd_id,ad_id}=req.body
  if(sd_id&&ad_id){
    res.send({code:308,msg:"sd_id(服务详情ID)，ad_id(用户id) 不可为空"})
  }else{
    pool.query('insert into order_form set ?',[req.body],(err,r)=>{
      if(err){
        return next(err)
      }
      res.send({code:200,msg:"添加完成"})
    })
  }
})


module.exports = router